﻿///时间：2021年11月29日
///单位：华南理工大学吴贤铭智能工程
///作者：陈琦
///功能描述：写日志接口
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RoboSensors.Tools
{
    public interface ILogWriter
    {
        void WriteLogInfo(MsgInfo msg);
        void Close();
    }

    public enum ErrLevel
    {
        Error = 0,
        Warn = 1,
        Debug = 2,
        Info = 3,
        Status,
        Log,
        Operation
    }

    public class MsgInfo
    {
        public string Caption { get; set; }
        public string Content { get; set; }
        public ErrLevel ErrLevel { get; set; }

        public MsgInfo()
        {
            ErrLevel = ErrLevel.Warn;
            Caption = "日志";
        }
        public MsgInfo(string content, ErrLevel errLevel = ErrLevel.Warn, string caption = "日志")
        {
            ErrLevel = errLevel;
            Content = content;
            Caption = caption;
        }
    }
}
